www.gusucode.com > VC免费界面库 AppFace应用实例-源码程序 > VC免费界面库 AppFace应用实例-源码程序/code/Samples/VC6/DemoSdi/DemoSdiView.cpp

    // DemoSdiView.cpp : implementation of the CDemoSdiView class
// Download by http://www.NewXing.com

#include "stdafx.h"
#include "DemoSdi.h"

#include "DemoSdiDoc.h"
#include "DemoSdiView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDemoSdiView

IMPLEMENT_DYNCREATE(CDemoSdiView, CView)

BEGIN_MESSAGE_MAP(CDemoSdiView, CView)
	//{{AFX_MSG_MAP(CDemoSdiView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDemoSdiView construction/destruction

CDemoSdiView::CDemoSdiView()
{
	// TODO: add construction code here

}

CDemoSdiView::~CDemoSdiView()
{
}

BOOL CDemoSdiView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CDemoSdiView drawing

void CDemoSdiView::OnDraw(CDC* pDC)
{
	CDemoSdiDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CDemoSdiView printing

BOOL CDemoSdiView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CDemoSdiView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CDemoSdiView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CDemoSdiView diagnostics

#ifdef _DEBUG
void CDemoSdiView::AssertValid() const
{
	CView::AssertValid();
}

void CDemoSdiView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CDemoSdiDoc* CDemoSdiView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDemoSdiDoc)));
	return (CDemoSdiDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CDemoSdiView message handlers